package com.sykj.why.mongo.enums;

/**
 * @author Eleven
 * @date 2019/7/3
 * @Desc 地区枚举
 *
 */
public class AreaEnum {
    // 地区级别
    public enum Level {
        PROVINCIAL("省级", 0),
        MUNICIPAL("市级", 1),
        DISTRICT("区县级", 2),
        TOWNSHIP("乡镇级", 3);

        private String name;
        private Integer status;

        public String getName() {
            return name;
        }

        public Integer getStatus() {
            return status;
        }

        Level(String name, Integer status) {
            this.name = name;
            this.status = status;
        }

        public static String name(Integer status) {
            for (Level empType : Level.values()) {
                if (status.equals(empType.getStatus())) {
                    return empType.getName();
                }

            }
            return "未知状态";
        }


    }
}
